This invention relates generally to real time operating systems and in particular to a method and arrangement for dynamically changing device drivers in embedded systems.
Programmable devices are a class of general-purpose integrated circuits that can be configured for a wide variety of applications. Such programmable devices have two basic versions, mask programmable devices, which are programmed only by a manufacturer, and field programmable devices, which are programmable by the end user. In addition, programmable devices can be further categorized as programmable memory devices or programmable logic devices. Programmable memory devices include programmable read only memory (PROM), erasable programmable read only memory (EPROM) and electronically erasable programmable read only memory (EEPROM). Programmable logic devices include programmable logic array (PLA) devices, programmable array logic (PAL) devices, erasable programmable logic devices (EPLD) devices, and programmable gate arrays (PISA).
As chip capacity continues to increase significantly, the use of field programmable gate arrays (FPGAs) is quickly replacing the use of application specific integrated circuits (ASICs). An ASIC is a specialized microprocessor chip that is designed for a particular application. Notably, a FPGA is a programmable logic device (PLD) that has an extremely high density of electronic gates as compared to an ASIC. This high gate density has contributed immensely to the popularity of FPGA""s. Notably, FPGAs can be designed using a variety of architectures which can include user configurable input/output blocks (IOBs), and programmable logic blocks having configurable interconnects and switching capability.
The advancement of computer chip technology has also resulted in the development of embedded processors and controllers. An embedded processor or controller can be a microprocessor or microcontroller circuitry that has been integrated into an electronic device as opposed to being built as a standalone module or xe2x80x9cplugin card.xe2x80x9d Advancement of FPGA technology has led to the development of FPGA-based system-on-chips (SoC) including FPGA-based embedded processor system-on-chips. A SoC is a fully functional product having its electronic circuitry contained on a single chip. While a microprocessor chip requires ancillary hardware electronic components to process instructions, a SoC would include all required ancillary electronics. For example, a SoC for a cellular telephone can include a microprocessor, encoder, decoder, digital signal processor (DSP), RAM and ROM. It should be understood within contemplation of the present invention that an FPGA-Based SoC does not necessarily include a microprocessor or microcontroller. For example, a SoC for a cellular telephone could include an encoder, decoder, digital signal processor (DSP), RAM and ROM that rely on an external microprocessor. It should also be understood herein that xe2x80x9cFPGA-based embedded processor SoCsxe2x80x9d are a specific subset of FPGA-based SoCs that would include their own processors.
FPGA-based SoC have resulted in the proliferation of numerous consumer devices such as wireless telephones, personal digital assistants (PDAs), and digital cameras. In order for device manufacturers to develop FPGA-based SoCs, it is necessary for them to acquire intellectual property rights for system components and/or related technologies that are utilized to create the FPGA-based SoCs. These system components and/or technologies are called cores or IP cores. An electronic file containing system component information can typically be used to represent the core. A device manufacturer will generally acquire several cores that are integrated to fabricate the SoC.
In order to make their SoC products more marketable, SoC vendors are adding software support for the embedded or external processors. Software support includes device drivers and board support packages, and integration of these with various operating systems and processors. The hardware configuration of an FPGA-based SoC product can change over the product""s lifetime due to the programmable nature of the FPGA. Hardware devices within an FPGA-based SoC can be added or updated. A wide variety of systems, which can include any number of processors, busses, and peripherals can be easily built and rebuilt. An SoC vendor would want to provide software solutions that accommodate this ever-changing hardware and that would minimize the software development and maintenance costs and associated impact to customer applications. The programable nature of the FPGA dictates the need to change device drivers that support hardware devices within the FPGA.
Besides having numerous devices, a system can have multiple versions of the same device. On desktop computer systems (such as PC or Sparc), multiple versioning of devices is typically handled at the device driver level by one of two ways: (1) A single device driver supporting multiple versions of hardware. This is typically achieved through compiler directives or decision constructs spread throughout the source code. As the number of versions grows, so does the complexity of the device driver, quickly becoming a software maintenance nightmare. (2) Multiple device drivers, one for each version of the hardware. In an embedded system where an application is usually statically linked, each driver would require a different application programming interface (API) if the system were to support multiple versions of the device at the same time. Application developers would face a tremendous burden trying to support multiple interfaces to logically similar devices. Each driver could have the same API, but this limits the system and the application to only one version of the hardware device. This could be a severe limitation if adding a new device to a widely deployed SoC means upgrading all other devices of that same type within the SoC. Thus, a need exists for multiple device drivers with a common API, such that embedded applications can link these drivers into a single executable binary. Ideally, this flexible and dynamic device driver architecture would ease the maintenance burden of ever-changing hardware both for the SoC vendor and the customer using the SoC. Such an arrangement would be desirable for hardware vendors or programmable devices, such as Field Programmable Gate Array (FPGA) based System on Chip (SoC) vendors that are destined to provide software support for programmable hardware.
In a first aspect of the present invention, a logical device driver instance comprises a common interface for the device driver which comprises a plurality of functions linked to at least an embedded application. The logical device driver instance represents an instance of the hardware device. The logical device driver instance also comprises a virtual function table that points from each of the plurality of functions of the common interface to a plurality of functions of a specific version of the device driver among a plurality of versions of the device driver. Preferably, the plurality of function pointers in the virtual function table are set up dynamically during run-time initialization of the logical device driver instance. The logical device driver instance also comprises the specific version of the device driver pointed to by the virtual function table.
In a second aspect of the present invention, a method of supporting multiple device driver versions using a common interface to an embedded application comprises the steps of initializing a logical device driver instance through the common interface so that a plurality of functions for a given version of the device driver among a plurality of device driver versions are mapped to the common interface using a virtual function table and invoking the common interface with the embedded application to communicate with the given version of the device driver.
In a third aspect of the present invention, a method of simultaneously supporting a plurality of device driver versions using a common interface to an embedded application comprises the steps of initializing each logical device driver instance in a plurality of logical device driver instances through the common interface so that a plurality of functions of each version of the device driver among a plurality of device driver versions are mapped to the common interface using a virtual function table for each logical device driver instance and invoking the common interface with the embedded application to communicate with any instance of the device driver. Each logical device driver instance in the plurality of logical device driver instances can represent a different version of the device driver.